[IA64] get_wallclock also returns NOW value.
authorAlex Williamson <alex.williamson@hp.com>
Mon, 10 Mar 2008 17:10:46 +0000 (11:10 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 10 Mar 2008 17:10:46 +0000 (11:10 -0600)
At least sched_poll hypercall needs to have access to the NOW value
(time since boot).  This patch makes NOW available from sioemu.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
xen/arch/ia64/vmx/sioemu.c
xen/arch/ia64/xen/xentime.c
xen/include/asm-ia64/time.h

index fe6b740fd322b15251e2faf32a53e5f2cbac6580..6cabe82b373a78f199297d109ea9443fed54798f 100644 (file)
@@ -248,9 +248,10 @@ sioemu_hypercall (struct pt_regs *regs)
         break;
     case SIOEMU_HYPERCALL_GET_TIME:
     {
-        uint64_t sec, nsec;
-        get_wallclock(&sec, &nsec);
+        uint64_t sec, nsec, now;
+        get_wallclock(&sec, &nsec, &now);
         regs->r8 = (sec << 30) + nsec;
+        regs->r9 = now;
         break;
     }
     case SIOEMU_HYPERCALL_GET_REGS:
@@ -272,6 +273,7 @@ sioemu_hypercall (struct pt_regs *regs)
     case SIOEMU_HYPERCALL_CALLBACK_RETURN:
         regs->r2 = regs->r27;
         sioemu_callback_return ();
+        vcpu_decrement_iip(current);
         break;
     default:
         panic_domain (NULL, "bad sioemu hypercall %lx\n", regs->r2);
index 7579ef569dafdbe12c939e2507cea465795f5e33..710570731dcd8ebe2faf00a65ffa740dbb62555e 100644 (file)
@@ -253,9 +253,11 @@ struct tm wallclock_time(void)
     return gmtime(seconds);
 }
 
-void get_wallclock(uint64_t *sec, uint64_t *nsec)
+void get_wallclock(uint64_t *sec, uint64_t *nsec, uint64_t *now)
 {
-    uint64_t nano = NOW() + wc_nsec;
+    uint64_t n = NOW();
+    uint64_t nano = n + wc_nsec;
     *sec = wc_sec + nano / NSEC_PER_SEC;
     *nsec = nano % NSEC_PER_SEC;
+    *now = n;
 }
index f1d8ce11653ec48a6385f042e509a04bd73cb697..2361901ea6ea93d2c1f8ae6f698c0b43c8064b7c 100644 (file)
@@ -7,6 +7,6 @@
 struct tm;
 struct tm wallclock_time(void);
 
-void get_wallclock(uint64_t *sec, uint64_t *nsec);
+void get_wallclock(uint64_t *sec, uint64_t *nsec, uint64_t *now);
 
 #endif /* _ASM_TIME_H_ */